<template>
  <div id="app">
    <keep-alive :include="keepArr">
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

<script>
export default {

  data () {
    return {
      // 缓存组件名的数组
      keepArr: ['LayoutIndex']
    }
  }

}
</script>

<style lang="less">
.box {
  width: 300px;
  height: 300px;
  background-color: blueviolet;
}
</style>
